<form >
搜索企业：<input id="entsearchinput" name="corp_name_s" value="" style="width:240px;" /><input type="submit" value="搜" />
</form>
<link rel="stylesheet" type="text/css" href="__THEME__/css/jquery.autocomplete.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jqlib/external/jquery.bgiframe-2.1.2.js"></script>
<script type="text/javascript">
$().ready(function() {
	$("#entsearchinput").autocomplete(U('enterprise/Search/autofind')+'<php>if(isset($cstaus)){echo "&status=$cstaus";}</php>', <literal>{
		width			: $("#entsearchinput").width,
		max				: 15,
		selectFirst		: false,
		formatItem		: function(data, i, total) {return ""+data[0]+""; },   
        formatMatch		: function(data, i, total) { return data[0]; },   
        formatResult	: function(data) {return data[0]; },
		highlight		: function(value, term){
		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<span style='color:red'>$1</span>"); 
		}</literal>
	});
	$("#entsearchinput").result(function(event, data, formatted) {
		if (data)
			$(this).parent().next().find("input").val(data[1]);
	});
});
</script>